package com.ruoyi.business.factory.llm.user_type;

import com.ruoyi.business.factory.llm.AbstractUserTypeTemplate;
import com.ruoyi.business.mapper.SysUserMapper;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.user.UserException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * pc管理端
 *
 * @author 99
 * @className ChatGPTTemplate
 * @description TODO
 * @date 2023/4/17 11:48
 */
@RequiredArgsConstructor
@Service("sys_user")
@Slf4j
public class SysUserTemplate extends AbstractUserTypeTemplate {

    private final SysUserMapper sysUserMapper;

    /**
     * 通过短信注册
     *
     * @param phonenumber 手机号
     * @return
     */
    @Override
    public Boolean registerSms(String phonenumber) {
        throw new UserException("运营端暂不支持此方式注册");
    }

    /**
     * 通过手机号查询对应用户
     *
     * @param phonenumber 手机号
     * @return
     */
    @Override
    public SysUser selectUserByPhonenumber(String phonenumber) {
        return sysUserMapper.selectUserByPhonenumber(phonenumber);
    }
}
